package system.model;


import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 * Syrole entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "syrole", catalog = "sypro")
public class Syrole implements java.io.Serializable {

	// Fields

	private String id;
	private Syrole syrole;
	private String text;
	private BigDecimal seq;
	private String descript;
	private Set<SyroleSyresources> syroleSyresourceses = new HashSet<SyroleSyresources>(
			0);
	private Set<Syrole> syroles = new HashSet<Syrole>(0);
	private Set<SyuserSyrole> syuserSyroles = new HashSet<SyuserSyrole>(0);

	// Constructors

	/** default constructor */
	public Syrole() {
	}

	/** minimal constructor */
	public Syrole(String id, BigDecimal seq) {
		this.id = id;
		this.seq = seq;
	}

	/** full constructor */
	public Syrole(String id, Syrole syrole, String text, BigDecimal seq,
			String descript, Set<SyroleSyresources> syroleSyresourceses,
			Set<Syrole> syroles, Set<SyuserSyrole> syuserSyroles) {
		this.id = id;
		this.syrole = syrole;
		this.text = text;
		this.seq = seq;
		this.descript = descript;
		this.syroleSyresourceses = syroleSyresourceses;
		this.syroles = syroles;
		this.syuserSyroles = syuserSyroles;
	}

	// Property accessors
	@Id
	@Column(name = "ID", unique = true, nullable = false, length = 36)
	public String getId() {
		return this.id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "PID")
	public Syrole getSyrole() {
		return this.syrole;
	}

	public void setSyrole(Syrole syrole) {
		this.syrole = syrole;
	}

	@Column(name = "TEXT", length = 100)
	public String getText() {
		return this.text;
	}

	public void setText(String text) {
		this.text = text;
	}

	@Column(name = "SEQ", nullable = false, precision = 22, scale = 0)
	public BigDecimal getSeq() {
		return this.seq;
	}

	public void setSeq(BigDecimal seq) {
		this.seq = seq;
	}

	@Column(name = "DESCRIPT", length = 100)
	public String getDescript() {
		return this.descript;
	}

	public void setDescript(String descript) {
		this.descript = descript;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "syrole")
	public Set<SyroleSyresources> getSyroleSyresourceses() {
		return this.syroleSyresourceses;
	}

	public void setSyroleSyresourceses(
			Set<SyroleSyresources> syroleSyresourceses) {
		this.syroleSyresourceses = syroleSyresourceses;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "syrole")
	public Set<Syrole> getSyroles() {
		return this.syroles;
	}

	public void setSyroles(Set<Syrole> syroles) {
		this.syroles = syroles;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "syrole")
	public Set<SyuserSyrole> getSyuserSyroles() {
		return this.syuserSyroles;
	}

	public void setSyuserSyroles(Set<SyuserSyrole> syuserSyroles) {
		this.syuserSyroles = syuserSyroles;
	}

}